import qs from "qs";
import request from "@/request/request";

// 精品推荐
export const JinPinAIP = () => request.get("/products/recommend");
// 热门兑换
export const RenMenAIP = () => request.get("/products/hot");

// 详情页请求
export const GetDetailsAIP = (id) => request.get(`/products/${id}`);

// 短信请求
export const SendSMSAIP = (params) => request.post("/sendSMS", qs.stringify(params));
// 转换后
// phone=16611112222&
// 手机登录请求
export const PhoneReginAPI = (params) => request.post("/phoneRegin", qs.stringify(params));
// 微信扫码登录请求
export const PCLoginAPI = (params) => request.post("/wechatUsers/PCLogin", qs.stringify(params));

// 手机关联请求
export const BindingAPI = (params) => request.post("/wechatUsers/binding", qs.stringify(params));

// 用户信息请求
export const UserProfilesAIP = () => request.get("/shop/userProfiles");


// 添加带购物车

// /shop/carts/add
export const AddAPI = (params) => request.post("/shop/carts/add", qs.stringify(params));

// 所有产品-搜索
export const ProductsAIP = (params) => request.get("/products", { params });


// 购物车请求
export const CartsAIP = () => request.get("/shop/carts");


// 删除购物车 /shop/carts?productIds={id}
export const DeleteCartsAIP = (params) => request.delete(`/shop/carts?productIds=${params}`);
